import { Schema, Document, model } from 'mongoose';

const HouseSchema = new Schema({
    plane: Array,
    solid: Array,
    dimensional: String,
    dimensionalConfig: {
        type: [Object],
    },
    piece: String,
    etage: String,
    price: String,
    surface: Number,
    nom: { type: String, unique: true },
});

const HouseModel = model < HouseDocument > ('house', HouseSchema);

export interface HouseDocument extends Document {
    plane: string[];
    solid: string[];
    dimensional: string;
    dimensionalConfig: {
        left: number,
        top: number,
        to: string,
    }[];
    piece: string;
    etage: string;
    price: string;
    surface: number;
    nom: string;
}

export default HouseModel;
